package com.tedu._04mybatis.mapper;


import com.tedu._04mybatis.pojo.User;
import com.tedu._04mybatis.pojo.UserVO1;
import com.tedu._04mybatis.pojo.UserVO2;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserMapper{
//    @Insert("insert into user(username,password,nickname,created) values(#{username},#{password},#{nickname},#{created})")
    int insert(User user);
//    @Delete("delete from user where id= #{id}")
    int deleteUserById(Integer id);
//    @Update("update user set username=#{username},password=#{password},nickname=#{nickname},created=#{created} where id=#{id}")
    int updateUserById(User user);
//    @Select("select id,username,password,nickname,created from user where username=#{username}")
    User selectByUsernameAndPassword(String username,String password);

    int dynamicUpdateUser(User  user);
    int dynamicDeleteUser(Integer[] ids);
    int dynamicDeleteUser2(List<Integer> ids);

    int countUser();

    UserVO1 selectUserWeiboById(Integer id);

    UserVO2 selectUserCommentById(Integer id);

}
